package mr.ali.webvideo.controller;


import mr.ali.webvideo.model.OpenId;
import mr.ali.webvideo.service.IOpenIdService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Mr-ali
 * @since 2025-08-16
 */
@RestController
@RequestMapping("/h5/openId")
public class OpenIdController {
    @Resource
    private IOpenIdService openIdService;

    @GetMapping("/getById")
    public OpenId getOpenId(Integer id) {
        return openIdService.getById(id);
    }

    @GetMapping("/updateOpenId")
    public OpenId updateOpenId(Integer id, Long statusCreate) {
        return openIdService.updateOpenId(id,statusCreate);
    }

    @GetMapping("/deleteStatus")
    public OpenId deleteStatus(Integer id){
        return openIdService.deleteStatus(id);
    }

    @GetMapping("/money")
    public void updateMoney(Integer userId, Double money, Boolean close , String channel) {
        openIdService.updateNotMoney(userId, money, close , channel);
    }

}
